package commons;

import org.odftoolkit.odfdom.doc.style.OdfStyleTableCellProperties;

public class BorderStyle 
{
	private String border;
	private String top;
	private String right;
	private String bottom;
	private String left;
	
	public BorderStyle(String border)
	{	this.border = border;
	}

	public BorderStyle(String top, String right, String bottom, String left)
	{	this.top = top;
		this.right = right;
		this.bottom = bottom;
		this.left = left;
	}

	public static boolean checkBorders(BorderStyle border, OdfStyleTableCellProperties styleTableCellProps) 
	{	return border == null || 
			((border.border == null || border.border.equals(styleTableCellProps.getFoBorderAttribute()))
			&&  (border.top == null || (styleTableCellProps != null && border.top.equals(styleTableCellProps.getFoBorderTopAttribute())))
			&&  (border.right == null || border.right.equals(styleTableCellProps.getFoBorderRightAttribute()))
			&&  (border.bottom == null || border.bottom.equals(styleTableCellProps.getFoBorderBottomAttribute()))
			&&  (border.left == null || border.left.equals(styleTableCellProps.getFoBorderLeftAttribute())));
	}
}
